home *** CD-ROM | disk | FTP | other *** search
- #
- # Makefile for Tampa Network Operating System (TNOS)
- #
-
- ##############################################################################
- # #
- # The values in this Makefile SHOULD NOT need to be altered, and temptation #
- # to do so should be resisted. Doing so will make it easier to have major #
- # problems down the road as you upgrade to later versions. #
- # #
- # Instead, all local customizations should be placed in a separate file, #
- # named 'make.inc'. This file (if it exists) is included in the processing #
- # of this Makefile, and anything in that file can override settings in #
- # this file. #
- # #
- # Just say NO to editing the Makefile! If the author can resist the #
- # temptation, so can you ;-) #
- # #
- # There ARE notes throughout this Makefile as to things that you MAY wish #
- # to override in 'make.inc', so you are encouraged to look through here, and #
- # build your own 'make.inc' as needed. #
- # #
- ##############################################################################
-
-
- #######################
- # #
- # Version Variables #
- # #
- # DO NOT change these #
- # #
- #######################
-
- VERSION = 2
- RELEASE = 3
- LEVEL = 0
-
- # This defines whether this is a beta-test version or not. Make it blank
- # for release level compiles
- BETA = #-DBETA
-
- ifdef BETA
- # This is either 'a' for alpha, 'b' for beta, 'pl' for a interim patch
- # level, or ignored for release level compiles
- SUBTYPE = b
-
- # This will be ignored for release level compiles
- SUBLEVEL = 4
- endif
-
- VSTR = $(VERSION).$(RELEASE)$(LEVEL)$(SUBTYPE)$(SUBLEVEL)
- VERS = $(BETA) -DVERSION=\"$(VSTR)\"
-
- ifeq ($(strip $(BETA)),)
- VERS := $(VERS) -DNDEBUG
- endif
-
-
- #######################
- # #
- # Commands/Parameters #
- # #
- #######################
-
- #
- # Executable command names
- #
- # These are processed BEFORE the inclusion of any 'make.inc' files, to allow
- # you to easily override them to your needs.
- #
- CC = gcc
- RM = redir -e nul command /c del
- DEP = redir -e nul command /c
- AR = ar rcs
- MKDIR = mkdir
- COPY = copy
- TOUCH = touch
- STRIP = strip
- COFF2EXE = coff2exe
- RANLIB = ranlib
- MKVERS = mkvers
- PMODESTUB = true
- TCL = tclsh
- CONFIG_TARGETS = mkconfig.tcl config.in
- CATALOG_TARGETS = catalog.dat buildcat
- CATALOGPADDING = 0
-
-
- #######################
- # #
- # Supported Patches #
- # #
- #######################
-
- #
- # Supported patches are:
- #
- # -DIS_LITTLE_ENDIAN Intel byte ordering, vs. Motorola
- #
- PATCHES = -DIS_LITTLE_ENDIAN -DHAVE_TM_ISDST
-
-
-
- #######################
- # #
- # Warnings -- friends #
- # #
- #######################
-
- #
- # Warnings --- disable for less noise, enable for more certainty :-) gcc will
- # whine about things like partly bracketed initializers if you specify -W, but
- # this can be ignored unless you're trying to port JNOS to VMS....
- #
- # TNOS/Linux is much cleaner in this area, but there are some portability
- # warnings still (-Wtraditional) and some non-globally-prototyped functions.
- #
- WARNINGS = $(OPTIONAL)
-
-
- #
- # If you are using a non-GCC compiler, or a GCC compiler prior to 2.7.0, you
- # will want to override this next line in 'make.inc'. You will probably get
- # several warnings about unused parameters to functions, but those are to be
- # expected. If you are using GCC 2.7.0 or later, this line is fine.
- #
- OPTIONAL = -DOPTIONAL=
-
-
- #######################
- # #
- # OPTIMIZATION #
- # #
- #######################
-
- #
- # This should normally be fine, but if you encounter unusual errors compiling,
- # and the code LOOKS good, try redefining this in 'make.inc' as 'OPTIMIZE='
- #
- OPTIMIZE = -O2 -Wuninitialized
-
-
-
- #######################
- # #
- # Debugging Variables #
- # #
- #######################
-
- #
- # The following definition can be used to compile in code to help profile
- # the performance of TNOS. I do NOT suggest it's use in real-world situations,
- # as it adds to the size of the executable, uses more memory, and slows down
- # the execution of the program. If you DO wish to use it, though, then
- # override it in 'make.inc' as 'PROFILE = -pg'
- #
- PROFILE =
-
-
- #
- # I strongly advise leaving the debugging information in, because this is NOT
- # production-quality code. -g1 instead of -g3 will make nos smaller, however,
- # and leaving off -g entirely will make it a LOT smaller.
- #
- # I *DO*, though, remove the debugging info from official distribution
- # executables, in the interest of keeping download sizes smaller.
- #
- # The DBGLIB could be overriden in 'make.inc' to 'DBGLIB=-lefence' to compile
- # using the publicly available memory debugging tool 'Electric Fence', or
- # for other debugging libraries. 'Electric Fence' is not required for TNOS.
- #
- DEBUG = $(PROFILE) -g3
- DBGLIB =
-
-
- #
- # This is for use in testing. Don't worry about it unless you want to be
- # able to build custom versions.
- #
- NOS = tnos
-
-
-
- ###############
- # #
- # Directories #
- # #
- ###############
-
- #
- # This defines the root directory that you want TNOS installed into. You
- # *WILL* want to override this in 'make.inc', if you wish to install TNOS
- # anywhere else but '/nos'. The NOSDIRCMD *MUST* be the same thing, but with
- # backslashes. NOSDIRCMD is used for commands passed to COMMAND.COM.
- # NOSDIR *MUST* be forward slashes. Thanks, DOS!
- #
- # To make this easier to customize (and harder to goof up), use the ROOTDRIVE
- # and ROOTDIR variables, instead, to change the path.
- #
- ROOTDRIVE=c
- ROOTDIR=nos
- NOSDIR=$(ROOTDRIVE):/$(ROOTDIR)
- NOSDIRCMD=$(ROOTDRIVE):\$(ROOTDIR)
-
-
-
- #############################
- # #
- # User and System Overrides #
- # #
- #############################
-
-
- #
- # Include any files overridding any of these variables, if they exist
- #
- ifeq (make.inc,$(wildcard make.inc))
- include make.inc
- endif
-
-
-
- ####################################################
- # #
- # No user overridable variables beyond this point! #
- # #
- ####################################################
-
-
- KBRAW = kbraw.o
- CDEPFLAGS = -DMSDOS
-
-
-
- ############################
- # #
- # The primary targets used #
- # #
- ############################
-
-
- include makefile.all
-
- $(NOS): catalog.h $(REQUIRED) $(LIBS)
- echo --- Indexing All Archives
- $(RANLIB) $(LIBS)
- echo --- Linking: $(NOS)
- $(CC) $(CFLAGS) -o $(NOS) $(REQUIRED) $(LIBS) $(LCURSES) $(DBGLIB) $(LSQL) -lpc
- -$(MKVERS) $(NOSDIR)
-
-
- $(NOS).exe: $(NOS)
- echo --- Striping symbols from $(NOS).exe
- $(STRIP) $(NOS)
- $(COFF2EXE) $(NOS)
-
-
-
- ##############################################
- # #
- # Definition for making certain header files #
- # #
- ##############################################
-
-
- hardware.h: nospc.h
- $(COPY) nospc.h hardware.h
-
- config.h: $(CONFIG_TARGETS)
- echo $(NOSDIR) >nosdir
- $(TCL)
- -$(RM) nosdir
-
- catalog.h: $(CATALOG_TARGETS)
- buildcat $(CATALOGPADDING)
-
- make.inc:
- echo "No make.inc file found"
-
-
-
- ##########################
- # #
- # Administrative targets #
- # #
- ##########################
-
-
- zapVersion:
- echo --- Removing Version-specific object files
- -$(RM) mkvers.exe
- -$(RM) mkvers
- -$(RM) version.o
- -$(RM) mailbox.o
- -$(RM) catalog.o
- -$(RM) register.o
-
- clean:
- -$(RM) *.o
- -$(RM) *.a
- -$(RM) buildcat.exe
- -$(RM) buildctl.exe
- -$(RM) checkcat.exe
- -$(RM) ctlcheck.exe
- -$(RM) deldep.exe
- -$(RM) cnvfwd.exe
- -$(RM) mkvers.exe
- -$(RM) buildcat
- -$(RM) buildctl
- -$(RM) checkcat
- -$(RM) ctlcheck
- -$(RM) deldep
- -$(RM) cnvfwd
- -$(RM) mkvers
-
- realclean: clean
- -$(RM) config.h
- -$(RM) hardware.h
- -$(RM) depend
- -$(RM) $(NOS)
- -$(RM) $(NOS).exe
- echo "" >depend
-
-
- depend dep: hardware.h config.h catalog.h
- echo --- Determining Dependencies
- $(DEP) $(CC) -MM $(CDEPFLAGS) $(PATCHES) *.c >depend
-
- initial:
- $(MKDIR) $(NOSDIRCMD)
- $(MKDIR) $(NOSDIRCMD)\spool
- $(MKDIR) $(NOSDIRCMD)\public
- $(MKDIR) $(NOSDIRCMD)\finger
- $(MKDIR) $(NOSDIRCMD)\etc
- $(MKDIR) $(NOSDIRCMD)\spool\mail
- $(MKDIR) $(NOSDIRCMD)\spool\mail\control
- $(MKDIR) $(NOSDIRCMD)\spool\mail\users
- $(MKDIR) $(NOSDIRCMD)\spool\mqueue
- $(MKDIR) $(NOSDIRCMD)\etc\help
- $(MKDIR) $(NOSDIRCMD)\spool\info
- $(MKDIR) $(NOSDIRCMD)\spool\news
- $(MKDIR) $(NOSDIRCMD)\spool\signatur
- $(MKDIR) $(NOSDIRCMD)\spool\cmds
-
- install:
- $(COPY) $(NOS).exe $(NOSDIRCMD)
- $(COPY) ctlcheck.exe $(NOSDIRCMD)
- $(COPY) buildctl.exe $(NOSDIRCMD)
-
- touch:
- -$(TOUCH) config.h catalog.h
- -$(TOUCH) *.o
- -$(TOUCH) *.a
- -$(TOUCH) ctlcheck.exe buildctl.exe deldep.exe mkvers.exe
- -$(TOUCH) ctlcheck buildctl deldep mkvers
-
-
- applypatch:
- -patch -p1 -s -l <patchkit.*
- -$(RM) patchkit.*
-
- cleanpatch:
- -$(RM) *.c~ *.h~
-
-
-
- #######################################
- # #
- # Special cases for certain *.c files #
- # #
- #######################################
-
-
- kbraw.o: kbraw.s
-
-
-
-
- ##################
- # #
- # Explicit rules #
- # #
- ##################
-
-
- .c.o:
- echo --- Compiling: $<
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-
- .s.o:
- echo --- Assembling: $<
- $(CC) -c -o $@ $<
-
-
- #
- # and include a dependency file if one exists, which it SHOULD
- #
- ifeq (depend,$(wildcard depend))
- include depend
- endif
-
-
- .SILENT:
-
-
- .PHONY: $(NOS).exe
-
-
- #
- # finally, allow the user to define additional targets.
- # this is done at the end, rather than in make.inc, to avoid
- # having the default target of 'all' changed.
- #
- ifeq (make.end,$(wildcard make.end))
- include make.end
- endif
-
-